#pragma once
//Vertice can has one of the 5 types
enum verticeType
{
  _startVert,
  _endVert,
  _regularVert,
  _splitVert,
  _mergeVert
};



//This structure has an information about vertice
//and his status split and merge vertices
//This list is created after closing figure
//and points in this list are sorted and fit with 
//figureEdge structure
struct figureVertice : public POINT
{
public:
  //POINT _vertice;
  int   _priority; //it orders the point on the y-coordinates; in case two or more points has the same y-coordinate
                   //the point with smaller x-coordinate has a higher priority
  verticeType _type;
  figureVertice * prev;
  figureVertice * next; //Easy to navigate; the last vertice has a pointer to first and vice versa 

  bool operator < (const figureVertice &);
  bool operator > (const figureVertice &);
  bool operator < (const figureVertice *);

  bool operator == (const figureVertice &);
  bool operator == (const POINT &);
  //static bool sortMe(const figureVertice* t1, const figureVertice* t2);
  figureVertice & operator = (const POINT &);
};

//This structure covers the start point and end point
//and also some extra info
struct figureEdge
{
  figureVertice _begin;
  figureVertice _end;
  int   _order; //due to numbering the edges with clockwise turning, after sorting points
  figureEdge * prev;
  figureEdge * next;
  int          waycost;  
  bool operator < (const figureEdge &);
  

  bool operator > (const figureEdge &);

  bool operator == (const figureEdge & fg);
  
};

/*
typedef std::list<figureEdge>       faceList;
typedef faceList::iterator          faceFWIter;
typedef faceList::reverse_iterator  faceRWIter;
*/


bool operator > (const figureEdge & e1, const figureEdge & e2);

//bool operator < (const figureEdge & e1, const figureEdge & e2);

//bool operator == (const figureEdge & e1, const figureEdge & e2);

bool operator == (const figureVertice & , const figureVertice &);
bool operator != (const figureVertice & , const figureVertice &);



/*
template
class ptr_list<T> : public std::list<T *>
{
  ptr_list();
  ~ptr_list()
  {

  }

  void push_back(T _t)
  {
    T * t = new T;
    t = _t;
    ::push_back(t);
  }
};
*/

